<template>
  <van-field
    v-model="vModelValue"
    :name="name"
    :label="label"
    :required="required"
    :disabled="disabled"
    :rules="required ? rules : []"
    :placeholder="placeholder ? placeholder : '请填写' + label"
    :type="type"
    :autosize="autosize"
  />
</template>

<script>
import formMixin from './mixin'

export default {
  name: 'FormInput',
  mixins: [formMixin],
  props: {
    value: {
      type: String,
      required: true
    },
    placeholder: {
      type: String,
      default: ''
    },
    disabled: Boolean,
    type: {
      type: String,
      default: 'text'
    },
    autosize: Boolean
  }
}
</script>

<style lang="scss" scoped>
.flex-direction-col {
  .van-field {
    margin-top: 10px;
    /deep/ {
      .van-field__control {
        margin-top: 5px;
        border: 1px solid #cecece;
        text-indent: 1em;
      }
    }
  }
}
</style>
